<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
<!--
	$(function() {
		$( "input[name=productName]").autocomplete({
			source: products,
			autoFocus:true,
			minLength: 0,
			select: function( event, ui ) {
				var item = ui.item;
				var context = $(this).closest('div.order-item');
				$('input[name=productid]',context).val(item.productid||'');
				/* $('input[name=length]',context).val(item.length||'');
				$('input[name=width]',context).val(item.width||'');
				$('input[name=height]',context).val(item.height||''); */
				$('input[name=colorid]',context).val(item.colorid||'');
				$('input[name=colorName]',context).val(item.colorName||'');
			},
			response:function(event,_items){
				items = _items.content;
			},
			change:function(event, ui){
				var context = $(this).closest('.order-item');
				if ( ui.item ) {
					return;
				}
				else{
					$('input[name=productid]',context).val('');
					$(this).val('');
					$('input[name=colorid]',context).val('');
					$('input[name=colorName]',context).val('');
				}
			}
		});
		
		
		$('input[name=isNeedDoorLeaf_${itemIndex}]:eq(0)').click();
		$('input[name=isNeedDoorFrame_${itemIndex}]:eq(0)').click();
		$('input[name=isNeedLineShape_${itemIndex}]:eq(0)').click();
	});
//-->
</script>
<div class="order-item ui-widget line-item ">
	<div style="display: none;">
		<input type="text" value="${orderid}" name="orderid">
		<input type="text" name="productid">
		<input type="text" name="colorid">
		<input type="text" name="isNeedDoorFrame">
		<input type="text" name="isNeedDoorLeaf">
		<input type="text" name="isNeedLineShape">
	</div>
	<div class="ui-widget-header ui-corner-tl ui-corner-tr">
		<div class="ui-widget-title" style="padding:0.5em; position: relative;">订单项
		<div title="删除该订单项" class="ui-state-default ui-corner-all line-item-delete" style="padding: 4px;width: 16px;position: absolute;right:0px;top: 0px;cursor: pointer;">
			<span class="ui-icon ui-icon-close"></span>
		</div>
		</div>
	</div>
	<div class="ui-widget-content ui-corner-bl ui-corner-br">
		<div class="ui-helper-clearfix line-item">
			<label>款式：</label>
			<input type="text" class="ui-corner-all ui-widget-content" name="productName">
		</div>
		<div class="ui-helper-clearfix line-item">
			<label>颜色 ：</label>
			<input type="text" class="ui-corner-all ui-widget-content" name="colorName">
		</div>
		<div class="ui-helper-clearfix line-item">
			<label style="width: 100px;">是否需要门套 ：</label>
			<label style="width:20px;">是</label> <input type="radio" name="isNeedDoorFrame_${itemIndex}" value="true">
			<label  style="width:20px;margin-left: 50px;">否</label><input type="radio" name="isNeedDoorFrame_${itemIndex}" value="false">
		</div>
		<div style="background: #eee;padding-left: 80px; " class="door-frame-section">
			<div class="ui-helper-clearfix line-item">
				<label>门套数量 ：</label>
				<input type="text" class="ui-corner-all ui-widget-content" value="1" name="doorFrameAmount">
			</div>
			<div class="ui-helper-clearfix line-item">
				<label><span class="prefix"></span>门套长度 ：</label>
				<input type="text" class="ui-corner-all ui-widget-content" name="doorFrameLength">
			</div>
			<div class="ui-helper-clearfix line-item">
				<label><span class="prefix"></span>门套宽度 ：</label>
				<input type="text" class="ui-corner-all ui-widget-content" name="doorFrameWidth">
			</div>
			<div class="ui-helper-clearfix line-item">
				<label><span class="prefix"></span>门套厚度 ：</label>
				<input type="text" class="ui-corner-all ui-widget-content" name="doorFrameThickness">
			</div>
		</div>
		<div class="ui-helper-clearfix line-item">
			<label style="width: 100px;">是否需要门扇 ：</label>
			<label  style="width:20px;">是</label> <input type="radio" name="isNeedDoorLeaf_${itemIndex}" value="true">
			<label  style="width:20px;margin-left: 50px;">否</label><input type="radio" name="isNeedDoorLeaf_${itemIndex}" value="false">
		</div>
		<div style="background: #eee;padding-left: 80px;" class="door-leaf-section">
			<div class="ui-helper-clearfix line-item">
				<label>门扇数量 ：</label>
				<input type="text" class="ui-corner-all ui-widget-content" value="1" name="doorLeafAmount">
			</div>
			<div class="ui-helper-clearfix line-item">
				<label><span class="prefix"></span>门扇长度 ：</label>
				<input type="text" class="ui-corner-all ui-widget-content" name="doorLeafLength">
			</div>
			<div class="ui-helper-clearfix line-item">
				<label><span class="prefix"></span>门扇宽度 ：</label>
				<input type="text" class="ui-corner-all ui-widget-content" name="doorLeafWidth">
			</div>
			<div class="ui-helper-clearfix line-item">
				<label><span class="prefix"></span>门扇厚度 ：</label>
				<input type="text" class="ui-corner-all ui-widget-content" name="doorLeafThickness">
			</div>
		</div>
		<div class="ui-helper-clearfix line-item">
			<label style="width: 100px;">是否需要线型：</label>
			<label  style="width:20px;">是</label><input type="radio" name="isNeedLineShape_${itemIndex}" value="true">
			<label  style="width:20px;margin-left: 50px;">否</label><input type="radio" name="isNeedLineShape_${itemIndex}" value="false">
		</div>
		<div style="background: #eee;padding-left: 80px;" class="line-shape-section">
			<div class="ui-helper-clearfix line-item">
				<label>线型数量 ：</label>
				<input type="text" class="ui-corner-all ui-widget-content" value="1" name="lineShapeAmount">
			</div>
			<div class="ui-helper-clearfix line-item">
				<label><span class="prefix"></span>线型名称 ：</label>
				<input type="text" class="ui-corner-all ui-widget-content" name="lineShapeName">
			</div>
			<div class="ui-helper-clearfix line-item">
				<label><span class="prefix"></span>线型备注 ：</label>
				<input type="text" class="ui-corner-all ui-widget-content" name="lineShapeRemark">
			</div>
		</div>
		<div class="ui-helper-clearfix line-item">
			<label>备注 ：</label><input type="text" class="ui-corner-all ui-widget-content" name="remark">
		</div>
	</div>
</div>